package day06;

import java.io.FileNotFoundException;
import java.io.RandomAccessFile;

public class Demo17 {

	public static void main(String[] args) throws Exception {
		String name = "abc/hello.txt";
		RandomAccessFile raf = new RandomAccessFile(name, "rw");

//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println(raf.read());
//		 System.out.println();

		
		
		raf.seek(0);
		int b = raf.read();
		while (b != -1) {

			System.out.print((char) b);
			b = raf.read();

		}
		
		System.out.println();

		
		
		// System.out.println();
		// raf.seek(0);
		// for (int i = 0; i < raf.length(); i++) {
		// System.out.print((char) raf.read());
		//
		// }

	}

}
